package com.yingma.common.controller;



import com.yingma.common.util.AjaxResult;
import com.yingma.system.entity.JcCustomer;
import com.yingma.system.service.JcCustomerService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * (JcCustomer)表控制层
 *
 * @author makejava
 * @since 2020-03-03 16:42:02
 */
@RestController
@RequestMapping("/jcCustomer")
public class JcCustomerController {
    /**
     * 服务对象
     */
    @Resource
    private JcCustomerService jcCustomerService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public JcCustomer selectOne(String id) {
        return this.jcCustomerService.queryById(id);
    }

    /**
     * 查询全部档案信息
     * @return
     */
    @ApiOperation("查看客户档案信息")
    @RequestMapping(value = "/dangan",method = RequestMethod.POST)
    public AjaxResult selectAll(String organziation,String customerName,Integer pageNum,Integer PageSize){
        List<JcCustomer> jcCustomerList= jcCustomerService.selectList(organziation, customerName, pageNum, PageSize);
        return AjaxResult.success(jcCustomerList);
    }



}
